package com.zhijiaoyun.service;

import com.zhijiaoyun.model.User;
import com.zhijiaoyun.model.dto.PageList;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface IUserService {

    User selectUserById(long id);

    PageList<User> pageByParams(int pageIndex, int pageSize, String username);

    void addUser(User user);

    void updataUser(User user);

    void deleteUserById(long id);

    void delete(User user);

    Integer countByIdName(long id, String name);

    User getUserByUsername(String username);

    User getUserByUserId(Long userId);

    User getUserByUsernameNotUserId(Long userId, String username);

    int getUserByKV(String typeName, String typeValue);

    User getUserByMobile(String mobile);

    User getUserByEmail(String email);

    int countAll();

    /**
     * 分页查询用户列表 username
     *
     * @param pageIndex
     * @param pageSize
     * @param username
     * @return
     */
    Map<String, Object> pageByUserName(int pageIndex, int pageSize, String username);

    /**
     * 用户登录
     *
     * @param email
     * @param password
     * @param device   mobile
     *                 browser
     * @param response
     * @return
     */
    Map<String, Object> login(String email, String password, String device, HttpServletResponse response);

    /**
     * 获取所有的用户
     * @return
     */
    List<User> listAll();
}
